//
//  DSUnitExerciseToolbar.h
//  DSJY
//
//  Created by 冯华强 on 16/10/26.
//  Copyright © 2016年 dsjy. All rights reserved.
//  练习的工具条

#import <UIKit/UIKit.h>
#import "DSUnitExercise.h"
#import "XCYAudioTool.h"

@class DSUnitExerciseToolbar, DSUnitListeningContent;
@protocol DSUnitExerciseToolbarDelegate <NSObject>
//时间到
- (void)unitExerciseToolbarDidTimerUp:(DSUnitExerciseToolbar *)toolbar;
//音乐背景点击
- (void)unitExerciseToolbarDidAudioButtonClick:(DSUnitExerciseToolbar *)toolbar;
@end

@interface DSUnitExerciseToolbar : UIView

//时间
@property (nonatomic, weak) UILabel *timeLabel;
//答对题
@property (nonatomic, weak) UIButton *rightButton;
//答错题
@property (nonatomic, weak) UIButton *wrongButton;
//标题
@property (nonatomic, weak) UILabel *titleLabel;
//播放器
@property (nonatomic, strong, readonly) AVAudioPlayer *player;

//单元练习点击获取分数、上下单元的对象
@property (nonatomic, assign) DSUnitExercise *unitExercise;

//启动倒计时
- (void)startTimerWithMinute:(NSInteger)minute pictures:(NSInteger)pictures;

//答题记录
@property (nonatomic, strong) NSMutableDictionary<NSNumber *, NSNumber *> *exercisDict;

//设置标题   1/11
- (void)setupTitleIndex:(NSInteger)index totalCount:(NSInteger)totalCount;

//花费秒数(在invalidate方法触发时会计算)
@property (nonatomic, assign, readonly) NSInteger stime;
//分数(在invalidate方法触发时会计算)
@property (nonatomic, assign, readonly) NSInteger score;
//停止时间
- (void)invalidate;

@property (nonatomic, weak) id <DSUnitExerciseToolbarDelegate> delegate;


#pragma mark - 音频按钮的
//播放音乐按钮
@property (nonatomic, weak, readonly) UIButton *audioBtn;

//模型
@property (nonatomic, strong) DSUnitListeningContent *listeningContent;

//停止－播放
- (void)stopToPlayMusic;

//播放
- (void)playMusic;

//停止
- (void)stopMusic;

@end
